package com.atguigu.spzx.user.controller;

import com.atguigu.spzx.common.result.Result;
import com.atguigu.spzx.user.service.SmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * SmsController
 * </p>
 *
 * @author flyduck
 * @since 2023/11/4
 */
@Api(tags = "短信接口")
@RestController
@RequestMapping("/api/user/sms")
public class SmsController {

    @Autowired
    private SmsService smsService;

    @ApiOperation("发送短信验证码")
    @GetMapping("/sendCode/{phone}")
    public Result sendCode(@PathVariable String phone){
        smsService.sendCode(phone);
        return Result.ok();
    }
}
